Attribute VB_Name = "modAddUniqueItem"
Private Declare Function SendMessageFind Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As String) As Long
Private Const WM_USER = &H400
Private Const LB_ERR = (-1)
Private Const LB_FINDSTRING = &H18F
    
Public Sub AddUniqueItem(lst As Control, ByVal txt As String)
    Dim t As String
    
    t = typeName(lst)
  
    If t = "ListBox" Or t = "ComboBox" Then
        Dim ret As Long
        
        ret = SendMessageFind(lst.hwnd, LB_FINDSTRING, 0, txt)
        Debug.Print ret
        If ret = LB_ERR Then
            lst.AddItem txt
        End If
    End If
    
End Sub
